﻿////////////////////////////////////////////////////////////////////////////
//
// Copyright 2013-2019; 2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
////////////////////////////////////////////////////////////////////////////

using ACAT.Core.WordPredictorManagement.Interfaces;
using System.Windows.Automation;

namespace ACAT.Core.PanelManagement.Common
{
    /// <summary>
    /// Argument used in the call to display a scanner.  Has all
    /// the context information to display the scanner
    /// </summary>
    public class StartupArg
    {
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        public StartupArg() : this("")
        {
        }

        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        /// <param name="panelClass">Class of the scanner (alphabet, numeric etc)</param>
        public StartupArg(string panelClass) : this (panelClass, null)
        {
        }

        public StartupArg(string panelClass, string panelConfig)
        {
            //init();
            PanelClass = panelClass;
            PanelConfig = panelConfig;
        }

        /// <summary>
        /// Optional user-defined arguments
        /// </summary>
        public object Arg { get; set; } = null;

        /// <summary>
        /// Auto-position the scanner to its default position?
        /// </summary>
        public bool AutoPosition { get; set; } = true;

        /// <summary>
        /// Is the scanner being used in as a panel for a
        /// dialog box?
        /// </summary>
        public bool DialogMode { get; set; } = true;

        /// <summary>
        /// The currently focused control in the application window
        /// </summary>
        public AutomationElement FocusedElement { get; set; } = null;

        /// <summary>
        /// Gets or sets the class of the scanner being displayed
        /// </summary>
        public string PanelClass { get; set; } = string.Empty;

        public string PanelConfig { get; set; } = null;

        public WordPredictionModes PredictionMode { get; set; } = WordPredictionModes.Sentence;

        /// <summary>
        /// When the form closes, whether it should exit ACAT
        /// </summary>
        public bool QuitAppOnFormClose { get; set; } = false;

        /// <summary>
        /// Initializes the class
        /// </summary>
        //private void init()
        //{
        //    PanelClass = string.Empty;
        //    PanelConfig = null;
        //    FocusedElement = null;
        //    DialogMode = false;
        //    Arg = null;
        //    AutoPosition = true;
        //    QuitAppOnFormClose = false;
        //}
    }
}